using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using ScottLane.VideoInbox.Sources;

namespace ScottLane.VideoInbox
{
    /// <summary>
    /// A source of videos.
    /// </summary>
    [XmlInclude(typeof(YouTubeSource))]
    public class VideoSource
    {
        #region Constructor

        /// <summary>
        /// Initializes a new instance of the VideoSource class.
        /// </summary>
        public VideoSource()
        {
            _lastChecked = DateTime.MinValue;
            _createInboxShortcut = true;
        }

        #endregion

        #region Properties

        protected string _folderPath;

        /// <summary>
        /// Gets or sets the path to the local video folder.
        /// </summary>
        public virtual string FolderPath
        {
            get { return _folderPath; }
            set { _folderPath = value; }
        }

        protected DateTime _lastChecked;

        /// <summary>
        /// The date that the source was last checked for new videos and playlists.
        /// </summary>
        public DateTime LastChecked
        {
            get { return _lastChecked; }
            set { _lastChecked = value; }
        }

        private bool _createInboxShortcut;

        /// <summary>
        /// Gets a value indicating whether an inbox shortcut will be created for the
        /// video source videos and playlists.
        /// </summary>
        public bool CreateInboxShortcut
        {
            get { return _createInboxShortcut; }
            set { _createInboxShortcut = value; }
        }

        #endregion

        #region Methods

        /// <summary>
        /// Checks the source for videos that have become available since the date last checked.
        /// </summary>
        public virtual List<Video> GetNewVideos()
        {
            return new List<Video>();
        }

        /// <summary>
        /// Checks the source for new videos that have become available since the specified start date.
        /// </summary>
        public virtual List<Video> GetNewVideos(DateTime startDate)
        {
            return new List<Video>();
        }

        /// <summary>
        /// Checks the source for new videos playlists.
        /// </summary>
        public virtual List<Playlist> GetNewPlaylists()
        {
            return new List<Playlist>();
        }

        /// <summary>
        /// Checks the source for new videos playlists that have become available since the specified start date.
        /// </summary>
        public virtual List<Playlist> GetNewPlaylists(DateTime startDate)
        {
            return new List<Playlist>();
        }

        #endregion
    }
}
